How to add icon logo in title bar using HTML ?
Adding an icon logo in the title bar refers to placing a small image or icon next to the title of a webpage in the browser’s tab. This visual identifier helps users quickly identify and differentiate between multiple open tabs. favicon enhances website recognition and SEO. By using the <link> tag with the rel attribute set to “icon” and href pointing to the icon file, the favicon is displayed in the browser tab alongside the title....
read more
How to position a div at the bottom of its container using CSS?
To position a div at the bottom of its container in CSS, you can use various approaches. Using absolute positioning involves setting `position: absolute;` and `bottom: 0;`, aligning the div at the container’s bottom. Flexbox achieves this by employing `display: flex;` and `margin-top: auto;`, while Grid utilizes `display: grid;` with a defined template that reserves space at the bottom for the targeted div....
read more
How to auto-resize an image to fit a div container using CSS?
To resize an image or video to fit inside a div container, you can use the object-fit property. This property is used to specify how the content should fit inside the container. With object-fit, you can set the content to maintain its aspect ratio or stretch to fill the entire container. This allows you to control how the content is displayed within a specific div container....
read more
PHP | Converting string to Date and DateTime
Converting the string to Date and DateTime uses several functions/methods like strtotime(), getDate(). We will see what these functions do. strtotime() – This is basically a function which returns the number of seconds passed since Jan 1, 1970, just like a linux machine timestamp. It returns the number of seconds passed according to the parameter passed to the function. Syntax...
read more
How to run JavaScript from PHP?
JavaScript is the client side scripting language and PHP is the server side scripting language. JavaScript is used as client side to check and verify client details and PHP is server side used to interact with database. In PHP, HTML is used as a string in the code. In order to render it to the browser, we produce JavaScript code as a string in the PHP code....
read more
How to align content of a div to the bottom using CSS ?
Basic property of CSS:...
read more
JavaScript Program to write data in a text File
In this article, we are going to learn how can we write data in a text file. There is a built-in Module or in-built library in NodeJs that handles all the writing operations called fs (File-System). It is basically a JavaScript program (fs.js) where a function for writing operations is written. Import fs-module in the program and use functions to write text to files in the system....
read more
Space between two rows in a table using CSS?
The space between two rows in a table can be done using CSS border-spacing and border-collapse property. The border-spacing property is used to set the spaces between cells of a table and border-collapse property is used to specify whether the border of table is collapse or not. The border-spacing attribute can only be used if border-collapse attribute is set to separate....
read more
How to include one CSS file in another?
Yes, It is possible to include one CSS file in another and it can be done multiple times. Also, import various CSS files in the main HTML file or the main CSS file. It can be done by using the @import keyword....
read more
Removing Array Element and Re-Indexing in PHP
In order to remove an element from an array, we can use unset() function which removes the element from an array and then use array_values() function which indexes the array numerically automatically....
read more
Binary Search In JavaScript
Binary Search is a searching technique that works on the Divide and Conquer approach. It is used to search for any element in a sorted array. Compared with linear, binary search is much faster with a Time Complexity of O(logN), whereas linear search works in O(N) time complexity...
read more
Javascript | Program to read text File
Given a text file, write a JavaScript program to extract the contents of that file. There is a built-in Module or in-built library in NodeJs that handles all the reading operations called fs (File-System). It is basically a JavaScript program (fs.js) where a function for reading operations is written. Import fs-module in the program and use functions to read text from the files in the system....
read more